import request from "@/axios/axios.ts";
import {RecordCRUD, RecordFuzzySearch} from "./type.ts";

enum API1 {
    A = '/inventory/record_list_crud',
    B = '/inventory/record_fuzzy_search'
}

export const req_record_create = (data: RecordCRUD<'create'>): Promise<any> => {
    return request.post<any, any>(API1.A, data)
}

export const req_record_delete = (data: RecordCRUD<'delete'>): Promise<any> => {
    return request.post<any, any>(API1.A, data)
}

export const req_record_update = (data: RecordCRUD<'update'>): Promise<any> => {
    return request.post<any, any>(API1.A, data)
}

export const req_record_read = (data: RecordCRUD<'read'>): Promise<any> => {
    return request.post<any, any>(API1.A, data)
}

export const record_fuzzy_search = (data: RecordFuzzySearch): Promise<any> => {
    return request.post<any, any>(API1.B, data)
}
